package com.ftg.learn.framework.spring.javabase;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author kangjx
 * @version 1.0
 * @date 2023/9/20 上午11:00
 */
public class LearnDemo {

    public static void main(String[] args) {
        //实例化容器  --  通过java
//        ApplicationContext as = new AnnotationConfigApplicationContext();
        AnnotationConfigApplicationContext as = new AnnotationConfigApplicationContext(Springconfig.class);
        //包扫描
//        as.scan("com.ftg.learn.framework.spring.annotation");

        //单一注入
//        as.register(Dark.class);
//        as.register(Dark.class);
//        as.register(Dark.class);
//        as.register(Dark.class);
//        as.register(Dark.class);
//        as.register(Dark.class);
//        as.register(Dark.class);
//        as.refresh();

        Dark dark1 = (Dark) as.getBean(Dark.class);
        dark1.setName("ttt");
        dark1.testAop();
    }

}
